package Test;
import java.util.*;

public class Test1 {
    public static void main(String[] args) {
       Scanner scanner = new Scanner(System.in);
       String str1 = scanner.nextLine();
       String str2 = scanner.nextLine();
       HashMap<Character,Integer> map = new HashMap<>();
       //遍历第一个字符串，看map中是否含有
        for (int i = 0; i < str2.length(); i++) {
            if(map.get(str2.charAt(i)) == null){
                map.put(str2.charAt(i),1);
            }else{
                map.put(str2.charAt(i),map.get(str2.charAt(i) + 1));
            }
        }
        String ret = "";
        for (int i = 0; i < str1.length(); i++) {
            if(map.get(str1.charAt(i)) == null){
                ret += str1.charAt(i);
            }
        }
        System.out.println(ret);
    }
}
